package com.lovegu.thrownable;

/**
 * @author 老顾
 * @title: DivideZero1
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/22 14:42
 */
public class DivideZero1 {
    int x;
    public static void main(String[] args) {
        int y;
        DivideZero1 c = new DivideZero1();
        try {
            y = 3 / c.x;
        } catch (ArithmeticException e) {
            System.out.println("divide by zero error!");
        }
        System.out.println("program ends ok!");
    }
}
